from django.db import models

class Tag(models.Model):
    name = models.CharField(
            verbose_name='Tag name',
            max_length=100
    )
    TYPE_CHOICES = (
        ('PE','person'),
        ('PL','place'),
        ('EV','event'),
        ('IM','important'),
    )
    type = models.CharField(
            verbose_name='Type of tag',
            max_length=2,
            choices=TYPE_CHOICES)

class Note(models.Model):
    class Meta:
        verbose_name = 'Note'
        verbose_name_plural = 'Notes'
    date_added = models.DateField(
            verbose_name='Date added',
            auto_now_add=True
    )
    #if null that the note is about the same day as created
    date_entry= models.DateField( 
		verbose_name='Date of entry',
	null=True, blank=True
    )
    content = models.TextField(
            verbose_name='Content',
            max_length=5000    
    )
    tags=models.ManyToManyField(Tag, null=True, blank=True)
